package com.qinge.blog.utils.aspect;

import com.qinge.blog.utils.result.JsonResult;
import com.qinge.blog.utils.result.ResultTool;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author QDW
 * @date 2022/5/5 20:17
 * @description controller切面
 **/
@Aspect
@Component
public class ControllerAspect {

    /**
     * @author QDW
     * @date 2022/5/5 21:05
     * @description 切面测试函数
     * @param proceedingJoinPoint
     * @return java.lang.Object
     **/
    @Around("execution(public *  com.qinge.blog..*.*Controller.*(..))")
    public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        JsonResult jsonResult= new JsonResult(true,proceedingJoinPoint.proceed());

        return  jsonResult.getData();
    }



}
